u
Unassemble the code for a managed method.
Syntax
!u [<MD>] [<IP>]
Parameters
<MD>
Method Description
Unassembles a method based on the given method descriptor.

<IP>
Instruction Pointer

Unassembles the method containing the given instruction pointer.
Example
0:004> !u 031c1540
Normal JIT generated code
[DEFAULT] Void debugstuff.Class1.Main(SZArray String)
Begin 031c1540, size 12
031c1540 55               push    ebp
031c1541 8bec             mov     ebp,esp
031c1543 50               push    eax
031c1544 894dfc           mov     [ebp-0x4],ecx
031c1547 ff15d4503e00     call    dword ptr [003e50d4] (debugstuff.Class1.Go)
031c154d 90               nop
031c154e 8be5             mov     esp,ebp
031c1550 5d               pop     ebp
031c1551 c3               ret
Comments
The output first displays the type of generated code. It will be one of the following values:

EJIT generated code
Normal JIT generated code
PreJIT generated code
Unknown JIT

Next, the output displays the method signature and then the resulting native instructions for the method.

You can pass a method descriptor address as shown in the following code example.

0:004> !Name2EE debugstuff.exe debugstuff.Class1.Main
--------------------------------------
MethodDesc: 3e5070
Name: [DEFAULT] Void debugstuff.Class1.Main(SZArray String)
-----------------------
0:004> !u 3e5070
Normal JIT generated code
[DEFAULT] Void debugstuff.Class1.Main(SZArray String)
Begin 031c1540, size 12
031c1540 55               push    ebp
031c1541 8bec             mov     ebp,esp
031c1543 50               push    eax
031c1544 894dfc           mov     [ebp-0x4],ecx
031c1547 ff15d4503e00     call    dword ptr [003e50d4] (debugstuff.Class1.Go)
031c154d 90               nop
031c154e 8be5             mov     esp,ebp
031c1550 5d               pop     ebp
031c1551 c3               ret

You can also pass an address anywhere within the JIT-compiled code, as shown below.

0:004> !u 031c1547
Normal JIT generated code
[DEFAULT] Void debugstuff.Class1.Main(SZArray String)
Begin 031c1540, size 12
031c1540 55               push    ebp
031c1541 8bec             mov     ebp,esp
031c1543 50               push    eax
031c1544 894dfc           mov     [ebp-0x4],ecx
031c1547 ff15d4503e00     call    dword ptr [003e50d4] (debugstuff.Class1.Go)
031c154d 90               nop
031c154e 8be5             mov     esp,ebp
031c1550 5d               pop     ebp
031c1551 c3               ret

This command can be useful to unassemble managed code when looking at a call stack, as shown in the following code example.

0:000> k
ChildEBP RetAddr  
0012f564 77f7f03f SharedUserData!SystemCallStub+0x4
0012f568 77f53504 ntdll!ZwRequestWaitReplyPort+0xc
0012f588 77e9760a ntdll!CsrClientCallServer+0x8a
0012f678 77e97744 KERNEL32!ReadConsoleInternal+0x18e
0012f6f0 77e976fe KERNEL32!ReadConsoleA+0x2b
0012f748 003da1ae KERNEL32!ReadFile+0x64
0012f7b8 031c3dd3 0x3da1ae
0012f810 031c3bfd 0x31c3dd3
0012f83c 031c3b79 0x31c3bfd
0012f858 031c3b27 0x31c3b79
0012f86c 031c3115 0x31c3b27
0012f89c 031c1633 0x31c3115
0012f8bc 031c154d 0x31c1633
0012f8c8 791ec57b 0x31c154d
0012f8d0 791eb5d6 mscorwks!CallDescrWorker+0x30
0012f9e4 791f3e2e mscorwks!MethodDesc::CallDescr+0x19d
0012fa90 791f3dec mscorwks!MethodDesc::CallDescr+0x3b
0012fab8 79233aa2 mscorwks!MethodDesc::Call+0x95
0012fb70 79233888 mscorwks!RunMain+0x197
0012fc88 792336db mscorwks!ClassLoader::ExecuteMainMethod+0x4f9

0:000> !u 031c154d 
Normal JIT generated code
[DEFAULT] Void debugstuff.Class1.Main(SZArray String)
Begin 031c1540, size 12
031c1540 55               push    ebp
031c1541 8bec             mov     ebp,esp
031c1543 50               push    eax
031c1544 894dfc           mov     [ebp-0x4],ecx
031c1547 ff15d4503e00     call    dword ptr [003e50d4] (debugstuff.Class1.Go)
031c154d 90               nop
031c154e 8be5             mov     esp,ebp
031c1550 5d               pop     ebp
031c1551 c3               ret

Note: If the method has not been JIT-compiled yet, it will display "Not jitted yet".